<?php
	session_start();
	$flag=0;
	if(!empty($_POST['ho_ten'])&&!empty($_POST['email'])&&!empty($_POST['ten_dn'])&&!empty($_POST['mat_khau']))
	{
		$_SESSION['ho_ten']=$_POST['ho_ten'];
		$_SESSION['email']=$_POST['email'];
		$_SESSION['ten_dn']=$_POST['ten_dn'];
		$_SESSION['mat_khau']=$_POST['mat_khau'];
		$flag=1;
	}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Session</title>
<style type="text/css">
<!--
.style5 {
	font-family: LucidaHandwriting, LucidaCalligraphy;
	font-size: 20px;
	font-weight: bold;
	color: #FFFFFF;
}
.style10 {font-family: Geneva, Arial, Helvetica, sans-serif; font-size: smaller; }
-->
</style></head>

<body>
<form name="form1" method="post" action="Bai3_1.php">
  <table width="350" border="0" align="center" cellpadding="2" cellspacing="2" bgcolor="#009FAA">
    <tr bgcolor="#B8C9D1">
      <td colspan="2" bgcolor="#006F77"><div align="center"><span class="style5">THÔNG TIN ĐĂNG NHẬP </span></div></td>
    </tr>
    <tr>
      <td width="102"><span class="style10">Họ và tên:</span></td>
      <td width="234"><span class="style10">
        <label>
        <input name="ho_ten" type="text" id="ho_ten" size="35">
        </label>
      </span></td>
    </tr>
    <tr>
      <td><span class="style10">Email:</span></td>
      <td><span class="style10">
        <label>
        <input name="email" type="text" id="email" size="35">
        </label>
      </span></td>
    </tr>
    <tr>
      <td><span class="style10">Tên đăng nhập: </span></td>
      <td><span class="style10">
        <label>
        <input name="ten_dn" type="text" id="ten_dn">
        </label>
      </span></td>
    </tr>
    <tr>
      <td><span class="style10">Mật khẩu </span></td>
      <td><span class="style10">
        <label>
        <input name="mat_khau" type="password" id="mat_khau">
        </label>
      </span></td>
    </tr>
    <tr>
      <td colspan="2" align="center">
          <input type="submit" name="Submit" value="Đăng nhập">      </td>
    </tr>
  </table>
</form>
<p align="center"><font color="#FF0000"></font>
	<?php
		if($flag=1)
		{
			echo "Chao ban: <span style='background-color:pink; font-weight:bold;'>".$_SESSION['ho_ten']."</span><br />";
			echo "Email: ".$_SESSION['email']."<br />";
			echo "Ten dang nhap: ".$_SESSION['ten_dn']."<br />";
			echo "Mat khau: ".$_SESSION['mat_khau']."<br />";
			echo "<a href='session_doc.php'>Click me!</>";
		}
	?>
</body>
</html>
